package com.my.study.jdbc.aop;

import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;

import java.lang.annotation.*;


/**
 * 多数据源事务注解
 *
 * @author Carlos
 */
@Target({ ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
public @interface MultiTransactional {

    String[] value();

    /**
     * 事务传播行为
     * @return
     */
    Propagation propagation() default Propagation.REQUIRED;

    /**
     * 事务隔离级别
     * @return
     */
    Isolation isolation() default Isolation.DEFAULT;

    /**
     * 哪些异常不会滚事务
     * @return
     */
    Class<? extends Throwable>[] noRollbackFor() default {};

}
